SORTALGORITHM=quicksort
CFLAGS = -DSORT=$(SORTALGORITHM) -Wall -pedantic
APP  = sort

SRCS = sort.c main.c
OBJS    = $(SRCS:.c=.o)

TESTSRCS = test.c sort.c
TESTOBJS = $(TESTSRCS:.c=.o)
TESTLIBS = -lcunit

$(APP) : $(OBJS)
	$(CC) $^ $(LDFLAGS) $(LIBS) -o $@

test: $(TESTOBJS)
	$(CC) $^ $(TESTLDFLAGS) $(TESTLIBS) -o $@
	./test

clean:
	$(RM) $(OBJS) $(APP)

